package com.appwoo.txtws.service;

import android.content.Context;
import android.util.Xml;
import com.appwoo.android.exception.NotFoundNetWorkException;
import com.appwoo.android.exception.TimeOutException;
import com.appwoo.android.util.DateHelper;
import com.appwoo.android.util.PullIO;
import com.appwoo.txtws.bean.RecordSoftBean;
import com.appwoo.txtws.bean.Record_SoftBean;
import com.appwoo.txtws.bean.SoftSortBean;
import com.appwoo.txtws.component.GetDateTime;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class SoftService
{
  public List<Record_SoftBean> getSoftList(String paramString1, String paramString2, String paramString3, int paramInt, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    if ((paramString3 == null) || ("".equals(paramString3)))
      paramString3 = DateHelper.getNowDate();
    Record_SoftBean localRecord_SoftBean = null;
    MsgService localMsgService = new MsgService();
    Object localObject1 = null;
    String str = localMsgService.sendMessage(paramString1, paramString2, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "RQGameBrowse</TYPE></HEAD><BODY><DataDate>" + paramString3 + "</DataDate><PageIndex>" + paramInt + "</PageIndex><PageSize>" + 10 + "</PageSize></BODY></MSG>", paramContext);
    Object localObject2 = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject2 = localXmlPullParser;
      i = ((XmlPullParser)localObject2).getEventType();
      if (i == 1)
      {
        Collections.sort((List)localObject1, new ComparatorNum());
        return localObject1;
      }
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      case 3:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject2).next();
      break;
      localObject1 = new ArrayList();
      continue;
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("List"))
        localRecord_SoftBean = new Record_SoftBean();
      if (localRecord_SoftBean != null)
        if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("GameName"))
        {
          localRecord_SoftBean.setGameName(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Allowed"))
        {
          localRecord_SoftBean.setAllowed(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Num"))
        {
          localRecord_SoftBean.setNum(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("VisitedTime"))
        {
          localRecord_SoftBean.setVisitedTime(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("ProcName"))
        {
          localRecord_SoftBean.setProcName(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Author"))
        {
          localRecord_SoftBean.setAuthor(((XmlPullParser)localObject2).nextText());
          continue;
          if ((((XmlPullParser)localObject2).getName().equalsIgnoreCase("List")) && (localObject1 != null) && (localRecord_SoftBean != null))
          {
            ((List)localObject1).add(localRecord_SoftBean);
            localRecord_SoftBean = null;
          }
        }
    }
  }

  public List<SoftSortBean> getSoftSort(String paramString1, String paramString2, String paramString3, int paramInt, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    MsgService localMsgService = new MsgService();
    if ((paramString3 == null) || ("".equals(paramString3)))
      paramString3 = DateHelper.getNowDate();
    Object localObject1 = null;
    SoftSortBean localSoftSortBean = null;
    String str = localMsgService.sendMessage(paramString1, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "RQGameTypeBrowse</TYPE></HEAD><BODY><BID>" + paramString2 + "</BID><DataDate>" + paramString3 + "</DataDate><PageIndex>" + paramInt + "</PageIndex><PageSize>" + 10 + "</PageSize></BODY></MSG>", paramContext);
    Object localObject2 = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject2 = localXmlPullParser;
      i = ((XmlPullParser)localObject2).getEventType();
      if (i == 1)
      {
        Collections.sort((List)localObject1, new ComparatorSortNum());
        return localObject1;
      }
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      case 3:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject2).next();
      break;
      localObject1 = new ArrayList();
      continue;
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("list"))
        localSoftSortBean = new SoftSortBean();
      if (localSoftSortBean != null)
        if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Type"))
        {
          localSoftSortBean.setType(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Num"))
        {
          localSoftSortBean.setNum(((XmlPullParser)localObject2).nextText());
          continue;
          if ((localObject1 != null) && (localSoftSortBean != null) && (((XmlPullParser)localObject2).getName().equalsIgnoreCase("list")))
          {
            ((List)localObject1).add(localSoftSortBean);
            localSoftSortBean = null;
          }
        }
    }
  }

  public List<RecordSoftBean> getUrlByType(String paramString1, String paramString2, String paramString3, String paramString4, int paramInt, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    RecordSoftBean localRecordSoftBean = null;
    MsgService localMsgService = new MsgService();
    Object localObject1 = null;
    if ((paramString4 == null) || ("".equals(paramString4)))
      paramString4 = DateHelper.getNowDate();
    String str = localMsgService.sendMessage(paramString1, paramString2, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "RQGameBrowseByType</TYPE></HEAD><BODY><DataDate>" + paramString4 + "</DataDate><GameType>" + paramString3 + "</GameType><PageIndex>" + paramInt + "</PageIndex><PageSize>" + 10 + "</PageSize></BODY></MSG>", paramContext);
    Object localObject2 = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject2 = localXmlPullParser;
      i = ((XmlPullParser)localObject2).getEventType();
      if (i == 1)
        return localObject1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      case 3:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject2).next();
      break;
      localObject1 = new ArrayList();
      continue;
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("List"))
        localRecordSoftBean = new RecordSoftBean();
      if (localRecordSoftBean != null)
        if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("GameName"))
        {
          localRecordSoftBean.setGameName(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Num"))
        {
          localRecordSoftBean.setNum(((XmlPullParser)localObject2).nextText());
          continue;
          if ((((XmlPullParser)localObject2).getName().equalsIgnoreCase("List")) && (localObject1 != null) && (localRecordSoftBean != null))
          {
            ((List)localObject1).add(localRecordSoftBean);
            localRecordSoftBean = null;
          }
        }
    }
  }

  public class ComparatorNum
    implements Comparator
  {
    public ComparatorNum()
    {
    }

    public int compare(Object paramObject1, Object paramObject2)
    {
      Record_SoftBean localRecord_SoftBean1 = (Record_SoftBean)paramObject1;
      Record_SoftBean localRecord_SoftBean2 = (Record_SoftBean)paramObject2;
      if (Integer.parseInt(localRecord_SoftBean1.getNum()) > Integer.parseInt(localRecord_SoftBean2.getNum()))
        return -1;
      return 0;
    }
  }

  public class ComparatorSortNum
    implements Comparator
  {
    public ComparatorSortNum()
    {
    }

    public int compare(Object paramObject1, Object paramObject2)
    {
      SoftSortBean localSoftSortBean1 = (SoftSortBean)paramObject1;
      SoftSortBean localSoftSortBean2 = (SoftSortBean)paramObject2;
      if (Integer.parseInt(localSoftSortBean1.getNum()) > Integer.parseInt(localSoftSortBean2.getNum()))
        return -1;
      return 0;
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.service.SoftService
 * JD-Core Version:    0.6.2
 */